<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="index.css">
</head>

<body>
    <div class="login-form">
        <h2>Login</h2>
        <form>
            <label for="username">Username:</label>
            <input type="text" id="username" name="username">
            <label for="password">Password:</label>
            <input type="password" id="password" name="password">
            <button type="submit">Submit</button>
        </form>
    </div>
    <script>
        window.onload = function () {
            document.querySelector('.login-form').classList.add('active');
        }

        document.querySelector('form').addEventListener('submit', function (event) {
            event.preventDefault();
            document.querySelector('.login-form').classList.add('inactive');
        });

    </script>
</body>

</html>